#include <iostream>

using namespace std;

struct Node {
  int element_;
  Node* next_;

  Node(int element, Node* next = NULL) : element_ (element) , next_ (next) {}
  
};

void print(const Node& head) {
  const Node* itr = &head;

  while(itr != NULL) {
    cout << itr->element_ << endl;
    itr = itr->next_;
  }
}

// hwk implement: void reverse(const Node & head, Node *& reverse_head)

int main() {

  Node n1(7);
  Node n2(5);
  Node n3(1);
  n1.next_ = &n2;
  n2.next_ = &n3;

  //  cout << n1.element_ << endl;
  print(n1);
  return 0;
}
